package com.micro.download;

import org.jetbrains.annotations.NotNull;

import java.util.concurrent.ThreadFactory;

/**
 * @author dufen
 */
public class MyThreadFactory implements ThreadFactory {
    private String groupName;
    private String threadName;
    public MyThreadFactory(String groupName,String threadName) {
        this.groupName = groupName;
        this.threadName = threadName;
    }

    @Override
    public Thread newThread(@NotNull Runnable runnable) {
        return new Thread(new ThreadGroup(groupName),runnable,threadName);
    }
}
